<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib uri="http://www.rapid-framework.org.cn/rapid" prefix="rapid" %>
<%@ include file="nav.jsp"%>
<%@ include file="logo.jsp"%>
<%@ include file="item.jsp"%>
<%@ include file="footer.jsp" %>
<rapid:override name="contentContainer">
	<div class="row">
    <div class="col-sm-11 col-lg-11 col-md-11 profileBox">
		<%
		UserInfo userInfo = null;
		String addedDetail = null;
		try{
			if(session != null){
				userInfo = (UserInfo)session.getAttribute("user");
				addedDetail = (String)session.getAttribute("addedDetail");
				session.setAttribute("addedDetail", null);
				
			}
		}
		catch (Exception e){
			out.print("null");
		}
			
		%>
		<div class="center">
     		<h1 style="color: #0ea6b5 !important;font-weight: 800 !important;font-size: 40px !important; line-height: 50px !important;letter-spacing: 0 !important;">
     			<%if(userInfo != null){
     				out.print( userInfo.getPetName());}
     			else{
     				out.print("没有");
     			}
				%> 的用药情况如下
     			</h1>
     	</div>
     	<div class="center">
     		<h4 style="color: #0ea6b5 !important;font-weight: 800 !important;font-size: 40px !important; line-height: 50px !important;letter-spacing: 0 !important;">
     			<%if( addedDetail!= null){
     				out.print( addedDetail);}
     			else{
     				out.print("");
     			}
				%>
     			</h4>
     	</div>
     	<div class="center">
	      	<div class="float-left margin-btn"><a class="btn-yellow" href=<%if(userInfo != null){out.print("/pethub/add-medicals/" + userInfo.getID());}else{out.print("#");} %> style="font-size:larger" id='addMedical'>添加药品</a></div>
			<div class="float-left margin-btn"><a class="btn-yellow" href=<%if(userInfo != null){out.print("/pethub/add-allergy/" + userInfo.getID());}else{out.print("#");} %> style="font-size:larger" id='addAllergy'>添加过敏</a></div>
			<div class="float-left margin-btn"><a class="btn-yellow" href=<%if(userInfo != null){out.print("/pethub/add-condition/" + userInfo.getID());}else{out.print("#");} %> style="font-size:larger" id='addCondition'>添加身体状况</a></div>
			<div class="float-left margin-btn"><a class="btn-yellow" href=<%if(userInfo != null){out.print("/pethub/add-procedure/" + userInfo.getID());}else{out.print("#");} %> style="font-size:larger" id='addProcedure'>添加手术情况</a></div>
			<div class="float-left margin-btn"><a class="btn-yellow" href=<%if(userInfo != null){out.print("/pethub/add-vaccination/" + userInfo.getID());}else{out.print("#");} %> style="font-size:larger" id='addVaccination'>添加疫苗情况</a></div>
			<div class="clearfix"></div>
	  	</div>
     	<div class="row center">
		 	<div class="imageBlock" style="border: 0px;box-shadow: 5px 5px 20px #888888;">
			    <img src=<%if(userInfo != null){out.print(userInfo.getImageUrl());}else{out.print("null");} %> style="width:300px;"/>
			</div>
		</div>
		<div class="clearfix"></div>
		
	</div>
</rapid:override>
<%@ include file="base.jsp" %>
<script type="text/javascript">
	function addMedical(){
		var providerDetail = document.getElementById("providerDetail");
		$.ajax({
		    url: "/pethub/providerDetail/"+<%if(userInfo != null){out.print( userInfo.getID());}else{out.print("null");}%>,
		    data: {'provider':providerDetail.value},
		    type: 'POST',
		    success: function(msg) {
	            alert("更新成功");
	        },
	        error:function(msg) {
	        	alert("更新失败");
	        }
		  });
	}
</script>